
const adminpermissions = [
    { key: '/', label: "首页", path: "/", element: "./views/Echarts/Echarts" },
    {
        key: '/public',
        label: "通用",
        path: "/public",
        children: [
            { key: '/buttons', label: "按钮", path: "/buttons", element: "./views/Button/Button" },
            { key: '/icons', label: "图标", path: "/icons", element: "./views/Icons/Icons" },
            {
                key: '/others',
                label: "其他",
                path: "/others",
                children: [
                    { key: '/tables', label: "表格", path: "/tables", element: "./views/Tables/Tables" },
                    { key: '/texts', label: "富文本", path: "/texts", element: "./views/Texts/Texts" },
                ],
            },
        ],
    },
    { key: '/abouts', label: "关于", path: "/abouts", element: "./views/About/About" },
];

const otherpermissions = [
    { key: '/', label: "首页", path: "/", element: "./views/Echarts/Echarts" },
    { key: '/abouts', label: "关于", path: "/abouts", element: "./views/About/About" },
];
export default [
    {
        url: /\/login/,
        method: /post/,
        response: function (others) {
            if (others.body.username == "admin") {
                return {
                    code: 0,
                    msg: "登录成功",
                    token: `${others.body.username} token`,
                    user: {
                        data: adminpermissions,
                        user: others.body.username,
                        headpic: "xxxxxxx",
                        permissions: adminpermissions,
                    }

                }
            } else {
                return {
                    code: 0,
                    msg: "登录成功",
                    token: `${others.body.username} token`,
                    user: {
                        data: otherpermissions,
                        user: others.body.username,
                        headpic: "xxxxxxx",
                        permissions: otherpermissions,
                    }

                }
            }

        }
    }
]